namespace SmartSoft.ADP
{
    using System;
    using System.Data;
    using System.Data.SqlClient;

    public class DmYtDataAccess
{
private WSDmYtDataAccess.WSDmYtDataAccess wDataAcess = new WSDmYtDataAccess.WSDmYtDataAccess();
private SmartSoft.DAL.DmYtDataAccess oDataAcess = new SmartSoft.DAL.DmYtDataAccess();

        public DmYtDataAccess()
        {
            wDataAcess.Url = wDataAcess.Url.Replace("localhost", AdapterInstance.ServerIp);
        }
        public DataSet GetDataSet()
{
if (AdapterInstance.IsRemoteConnected)
{
return wDataAcess.GetDataSet();
}
else
{
return oDataAcess.GetDataSet();
}
        }

        public DataSet GetDataSet(string ps_Code)
{
if (AdapterInstance.IsRemoteConnected)
{
return wDataAcess.GetDataSet(ps_Code);
}
else
{
return oDataAcess.GetDataSet(ps_Code);
}
        }

        public int SaveRow(bool pb_NewChecked, DataRow row)
{
if (AdapterInstance.IsRemoteConnected)
{
return wDataAcess.SaveRow(pb_NewChecked, SmartSoft.DAL.SSDataAccess.ConvertRowToTable(row));
}
else
{
return oDataAcess.SaveRow(pb_NewChecked, row);
}
        }
    }
}

